<template>
  <div>
<!--    <a-input-search-->
<!--      v-model="textVals"-->
<!--      placeholder="请选择物料"-->
<!--      readOnly-->
<!--      unselectable="on"-->
<!--      @search="onSearchGoods">-->
<!--      <a-button slot="enterButton">选择物料</a-button>-->
<!--    </a-input-search>-->

    <buss-in-out-detail-list-modal
      ref="InOutDetailListModal"
      :modal-width="modalWidth"
      :category="category"
      :quantity="quantity"
      :code="code"
      @goodsOk="selectOK"/>
  </div>
</template>
<script>

import BussInOutDetailListModal from "@comp/base/modal/BussInOutDetailListModal";

export default {
  components: {BussInOutDetailListModal},
  props: {
    modalWidth: {
      type: Number,
      default: 1250,
      required: false
    },
    category: {
      type: String,
      default: '',
      required: false
    },
    code: {
      type: String,
      default: '',
      required: false
    },
    quantity: {
      type: String,
      default: '',
      required: false
    }
  },
  comments: {},
  data() {
    return {
      textVals: ''
    }
  },
  methods: {
    onSearchGoods() {
      this.$refs.InOutDetailListModal.showModal();
    },
    selectOK(rows) {
      this.textVals = "";
      if (rows) {
        this.textVals = rows.name;
        this.$emit("onInOutDetailSelected", rows);
      }
    }
  }
}
</script>